<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 解构赋值，实现两个变量的交换
    let a = 'hello';
    let b = 'world';
    [a, b] = [b, a];
    console.log(a);
    console.log(b);
  </script>
</body>

</html>